namespace EIP.System.Repository.Impl
{
    /// <summary>
    ///  
    /// </summary>
    public class SystemZeroCodeGridCustomRepository : ISystemZeroCodeGridCustomRepository
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="paging"></param>
        /// <returns></returns>
        public Task<PagedResults<SystemZeroCodeGridCustomFindOutput>> Find(SystemZeroCodeGridCustomFindInput paging)
        {
            var sql = new StringBuilder($@"SELECT GridCustomId
                                                 ,Config
                                                 ,Key
                                                 ,Title
                                                 ,CreateTime
                                                 ,CreateUserName
                                                 ,UpdateTime
                                                 ,UpdateUserName
                                                 ,@rowNumber 
                                                 ,@recordCount FROM system_zerocode_gridcustom @where  ");
            if (paging.Sort.IsNullOrEmpty())
            {
                paging.Sort = " Id ";
            }

            return new SqlMapperUtil().PagingQuerySqlAsync<SystemZeroCodeGridCustomFindOutput>(sql.ToString(), paging);
        }

    }
}